package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/method")
public class MethodController {
    //只展示了 处理请求方式为GET的请求，get()方法
    @RequestMapping(method = RequestMethod.GET)
    public void get() {
        System.out.println("RequestMethod.GET");
    }
    //处理请求方式为DELETE的请求，delete()方法
    //处理请求方式为POST的请求，post()方法
    //处理请求方式为PUT的请求，put()方法
    //...
    @RequestMapping(value = "/method",
            method = {RequestMethod.GET,RequestMethod.POST})
    public void getAndPost() {
        System.out.println("RequestMethod.GET+RequestMethod.POST");
    }
}
